﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TinyERP.ERP.Entity
{
    [NHibernate.Mapping.Attributes.Class(Table = "PhoneNumber", NameType = typeof(PhoneNumber))]
    public class PhoneNumber
    {
        [NHibernate.Mapping.Attributes.Id(0, TypeType = typeof(long), Column = "ID", Name = "ID")]
        [NHibernate.Mapping.Attributes.Generator(1, Class = "native")]
        public virtual long ID { get; set; }

        [NHibernate.Mapping.Attributes.Property(Column = "Extension")]
        public virtual string Extension{get;set;}

        [NHibernate.Mapping.Attributes.Property(Column = "Number")]
        public virtual string Number { get; set; }

        [NHibernate.Mapping.Attributes.Property(Column = "IsPrimaryPhoneNumber")]
        public virtual bool IsPrimaryPhoneNumber { get; set; }

        [NHibernate.Mapping.Attributes.Property(Column = "PhoneNumberType", TypeType=typeof(PhoneNumberType))]
        public virtual PhoneNumberType PhoneNumberType { get; set; }

        [NHibernate.Mapping.Attributes.ManyToOne(Column = "ContactID", ClassType = typeof(Contact))]
        public virtual Contact Contact { get; set; }
    }
    public enum PhoneNumberType
    {
        BUSINESS,
        HOME,
        MOBILE
    }
}
